<template>
    <view>
        <view class="kjkjnkjnmdr">
        	
        </view>
		<view class="pr">
			<view class="kjhnkhbedert row bgff cen">
				<view class="col z3 fz30 pr" @tap="kjnnmkjhsd(idx)" :class="idssds==idx?'b':''" v-for="(sd,idx) in jhggsd" :key="idx">
					{{sd}}
					<text class="kjnjkjeert" v-if="idssds==idx"></text>
				</view>
			</view>
			<view class="pd" v-if="idssds==0">
				<view  class="kjhnmkhsdf mt30 row"  v-for="(sd,idx) in creatg" :key="idx" @tap="oinfo(sd.id, sd.name)">
					<view class="jhbnjhserx cen cf fz32">
						{{sd.avatar}}
					</view>
					<view class="col row pl30">
						<view class="col mt5">
							<view class="fz32 z3">
								{{sd.name}}
							</view>
							<view class="z9 fz28 mt5">
								{{sd.region}} <text class="ml20">{{sd.nature}}</text>
							</view>
						</view>
						<uni-icons type="right" color="#999" size="18" class="mt30"></uni-icons>
					</view>
				</view>
			</view>
			
			
			<view class="pd" v-if="idssds==1">
				<navigator url="OrganizationForDetailser" class="kjhnmkhsdf mt30 row"  v-for="(sd,idx) in joing" :key="idx">
					<view class="jhbnjhserx cen cf fz32">
						{{sd.avatar}}
					</view>
					<view class="col row pl30">
						<view class="col mt5">
							<view class="fz32 z3">
								{{sd.name}}
							</view>
							<view class="z9 fz28 mt5">
								{{sd.region}} <text class="ml20">{{sd.nature}}</text>
							</view>
						</view>
						<uni-icons type="right" color="#999" size="18" class="mt30"></uni-icons>
					</view>
				</navigator>
			</view>
			
		</view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				idssds:0,
				jhggsd:['我创建的','我加入的'],
				creatg:{},
				joing:{}
			}
        },
        components: {},
        methods: {
			kjnnmkjhsd(idx){
				this.idssds = idx
			},
			oinfo(id,name){
				uni.navigateTo({
					url:"OrganizationForDetails?oid="+id+'&oname='+name
				})
				
			},
			async dengljse() {
				let cs = {}
				cs.gid = this.gid
				cs.id = this.uid
				let creatg=await this.get('/api/organization/1/my') // 我创建的
				let joing=await this.get('/api/organization/2/my') // 我加入的
				
				this.creatg = creatg.data
				this.joing = joing.data
			}
		},
		onLoad(options){
			this.dengljse();
		},
		onShow(options){
			
		},
		onNavigationBarButtonTap(e) {
			console.log(e)
			if(e.index == 0){
				uni.navigateTo({
					url:'AddGroup'
				})
			}
		},
        mounted() {}
    }

</script>
<style  scoped>
     .kjkjnkjnmdr{
		 position: fixed;
		 left: 0;
		 top: 0;
		 width: 100%;
		 height: 100%;
		 background-color: #f8f8f8;
		 z-index: 1;
	 }
	 .kjhnkhbedert{
		position: sticky;
		left: 0;
		top: 0;
		height: 100upx;
		line-height: 100upx;
	}
	.kjnjkjeert{
		width: 80upx;
		height: 6upx;
		background-color: #1689D5;
		position: absolute;
		left: 0;
		right: 0;
		margin: auto;
		bottom: 15upx;
		border-radius: 20%;
	}
	.kjhnmkhsdf{
		background:rgba(255,255,255,1);
		box-shadow:0px 6upx 12upx rgba(0,0,0,0.16);
		border-radius:12upx;
		padding: 48upx 30upx;
	}
	.jhbnjhserx{
		width:90upx;
		line-height: 90upx;
		height:90upx;
		background:rgba(22,137,213,1);
		border-radius:12upx;
	}
</style>
